// pages/home/home.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
      time:18000,
      hour:0,
      mint:0,
      secd:0,
      list:[{url:'https://gw.alicdn.com/tps/i4/722317031/O1CN01OZaoRz21oFar5ik7C_!!0-item_pic.jpg_Q75.jpg',goodsN:'夏季纯色t恤男款2024新款美式宽松大码',goodsP:'27.55'},
      {url:'https://gw.alicdn.com/tps/i4/722317031/O1CN01YFyfq021oFaGWWKf8_!!0-item_pic.jpg_Q75.jpg',goodsN:'t恤男短袖夏季日系复古重磅半袖cityboy男生圆领宽松上衣五分体恤',goodsP:'26.88'},
      {url:'https://gw.alicdn.com/tps/i4/2089360157/O1CN01rwKMAg1D1x2wWSICp_!!0-item_pic.jpg_Q75.jpg',goodsN:'沙滩裤男夏季速干花短裤薄款宽松休闲卡通居家睡裤可外穿大裤衩潮',goodsP:'25.0'}],
      swiper_img:['https://img.alicdn.com/imgextra/i2/6000000001542/O1CN01nqVQlK1NGHgK30MKx_!!6000000001542-0-octopus.jpg',
    'https://img.alicdn.com/imgextra/i2/6000000004597/O1CN01qPEonl1jpTfB3oPuD_!!6000000004597-0-octopus.jpg',
  'https://img.alicdn.com/imgextra/i2/O1CN01ybMQoB1iBnjkxYG4Y_!!6000000004375-0-tps-480-672.jpg',
  'https://gw.alicdn.com/imgextra/i1/O1CN01AGhkGV1rZv8WF2MKS_!!6000000005646-0-tps-480-672.jpg',
  'https://img.alicdn.com/imgextra/i3/6000000000530/O1CN01ueImQg1FmmrajtLLI_!!6000000000530-0-octopus.jpg'
]

    },
    todetail(){
     wx.navigateTo({
       url: '/pages/detail/detail',
     })
    },
    tosearch(){
      wx.navigateTo({
        url: '/pages/category/category',
      })
    },
    newpage(){
      wx.navigateTo({
        url: '/pages/Classified/Classified',
      })
    },

    countdown(){
      var h = Math.floor(this.data.time/3600)
      var hour=h<10?'0'+h:h;
      var mint=Math.floor(this.data.time / 60 % 60 );
      var secd=this.data.time % 60
      secd<10?secd='0'+secd:'';
      this.setData({
          hour,
          mint,
          secd,
          time:this.data.time-1
        })
      setTimeout(this.countdown, 1000);
      console.log(hour,':',mint,':',secd)
    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        //  this.countdown()
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {

    }
})